﻿<Window x:Class="Greycastle.RUBuildin.View.BubbleWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:wpf="clr-namespace:WpfAnimatedGif;assembly=WpfAnimatedGif"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:wpfLoaders="clr-namespace:Greycastle.RUBuildin.View"
        mc:Ignorable="d" 
                WindowStyle="None"
                Topmost="True"
                AllowsTransparency="True"
                Background="Transparent"
                ShowInTaskbar="False"
                Visibility="{Binding WindowVisibility, Mode=OneWay}"
                SizeToContent="WidthAndHeight"
                WindowStartupLocation="Manual">
    <Window.Resources>
        <Storyboard x:Key="CloseStoryboard" Duration="0:0:0.500" >
            <DoubleAnimation Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.500" />
            <DoubleAnimation Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)" From="0" To="40" Duration="0:0:0.500"/>
        </Storyboard>
        <Storyboard x:Key="OpenStoryboard" Duration="0:0:0.500">
            <DoubleAnimation Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.500"/>
            <DoubleAnimation Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)" From="40" To="0" Duration="0:0:0.500"/>
        </Storyboard>
    </Window.Resources>
    <Grid Name="MainGrid">
        <Grid.RenderTransform><TranslateTransform/></Grid.RenderTransform>
        <Grid Width="125" Height="125">
            <wpfLoaders:RadialLoader Width="125" Height="125" Radius="40" NumberOfElements="30" HorizontalAlignment="Center" VerticalAlignment="Center">
                <wpfLoaders:RadialLoader.Animation>
                    <Storyboard Duration="0:0:2" RepeatBehavior="Forever">
                        <DoubleAnimation Storyboard.TargetProperty="Width" From="1" To="20" Duration="0:0:1"/>
                    </Storyboard>
                </wpfLoaders:RadialLoader.Animation>
                <wpfLoaders:RadialLoader.ElementTemplate>
                    <DataTemplate>
                        <Rectangle Width="20" Height="4" Fill="{Binding Converter={x:Static wpfLoaders:ColorScaleConverter.Instance}}" Opacity="0.5"/>
                    </DataTemplate>
                </wpfLoaders:RadialLoader.ElementTemplate>
            </wpfLoaders:RadialLoader>
            <wpfLoaders:RadialLoader Width="150" Height="150" Radius="40" NumberOfElements="30" AnimationOffsetScale="5" HorizontalAlignment="Center" VerticalAlignment="Center">
                <wpfLoaders:RadialLoader.Animation>
                    <Storyboard Duration="0:0:2" RepeatBehavior="Forever">
                        <DoubleAnimation Storyboard.TargetProperty="Width" From="1" To="20" Duration="0:0:1" AutoReverse="True"/>
                    </Storyboard>
                </wpfLoaders:RadialLoader.Animation>
                <wpfLoaders:RadialLoader.ElementTemplate>
                    <DataTemplate>
                        <Rectangle Width="20" Height="4" Fill="{Binding Converter={x:Static wpfLoaders:ColorScaleConverter.Instance}}">
                            <Rectangle.RenderTransform>
                                <ScaleTransform ScaleX="-1"/>
                            </Rectangle.RenderTransform>
                        </Rectangle>
                    </DataTemplate>
                </wpfLoaders:RadialLoader.ElementTemplate>
            </wpfLoaders:RadialLoader>
        </Grid>
        <Border HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="7" Padding="3" Background="DarkSlateGray" BorderBrush="AntiqueWhite" BorderThickness="1">
            <TextBlock Foreground="Wheat" TextAlignment="Center">
                Construction in progress
            </TextBlock>
        </Border>
        <Grid.Triggers>
            <EventTrigger RoutedEvent="Window.Loaded">
                <BeginStoryboard Storyboard="{StaticResource OpenStoryboard}"/>
            </EventTrigger>
        </Grid.Triggers>
    </Grid>
</Window>
